﻿using System.Xml.Serialization;
using LibraryGuard.Interfaces.Configuration;

namespace LibraryGuard.Configuration
{
	/// <summary>
	/// Path guard configuration. See <see cref="LibraryGuard.Guards.PathGuard"/>.
	/// </summary>
	public sealed class PathGuard
		: IGuardConfiguration
	{
		#region Defaults
		private const string DefaultFormat = "${SafeName(Artists)}\\$[(Year > 0)Year + \" - \"]${SafeName(Album)}$[(TotalDiscs > 1) \"\\CD \" + Disc]\\${Track}. ${SafeName(Title)}.${Extension}";
		#endregion

		#region IGuardConfiguration Members
		/// <inheritdoc />
		[XmlAttribute]
		public bool Enabled { get; set; }
		#endregion

		#region Specific
		/// <summary>
		/// Path format.
		/// </summary>
		public string Format { get; set; }
		#endregion

		#region Constructors
		public PathGuard()
		{
			this.Format = DefaultFormat;
		}
		#endregion
	}
}
